package sctu.edu.java.year2016.team01.xuhanmei.day20160524.practice4;

/**
 * Created by Administrator on 2016/5/24.
 */

import java.util.Date;

public class GetTime {
    public static void main(String[] args) {
        Date date = new Date();

        System.out.println("默认的时间格式为:" + date);

        System.out.println("两位24小时制:" + String.format("%tH", date));

        System.out.println("两位12小时制:" + String.format("%tI", date));

        System.out.println("24小时制的小时:" + String.format("%tk", date));

        System.out.println("12小时制的小时:" + String.format("%tl", date));

        System.out.println("两位小时的分钟:" + String.format("%tM", date));

        System.out.println("两位分钟的秒:" + String.format("%tS", date));

        System.out.println("时区 缩写:" + String.format("%H", date));

        System.out.println("两位24小时制的小时:" + String.format("%tZ", date));

        System.out.println("上午还是下午：" + String.format("%tP", date));

    }
}
